use enigo::Key;
use serde::{Deserialize, Serialize};

#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum LKey {
    #[cfg(target_os = "windows")]
    #[serde(rename = "Num0")]
    Num0,
    #[cfg(target_os = "windows")]
    #[serde(rename = "Num1")]
    Num1,
    #[cfg(target_os = "windows")]
    #[serde(rename = "Num2")]
    Num2,
    #[cfg(target_os = "windows")]
    #[serde(rename = "Num3")]
    Num3,
    #[cfg(target_os = "windows")]
    #[serde(rename = "Num4")]
    Num4,
    #[cfg(target_os = "windows")]
    #[serde(rename = "Num5")]
    Num5,
    #[cfg(target_os = "windows")]
    #[serde(rename = "Num6")]
    Num6,
    #[cfg(target_os = "windows")]
    #[serde(rename = "Num7")]
    Num7,
    #[cfg(target_os = "windows")]
    #[serde(rename = "Num8")]
    Num8,
    #[cfg(target_os = "windows")]
    #[serde(rename = "Num9")]
    Num9,
    #[cfg(target_os = "windows")]
    #[serde(rename = "A")]
    A,
    #[cfg(target_os = "windows")]
    #[serde(rename = "B")]
    B,
    #[cfg(target_os = "windows")]
    #[serde(rename = "C")]
    C,
    #[cfg(target_os = "windows")]
    #[serde(rename = "D")]
    D,
    #[cfg(target_os = "windows")]
    #[serde(rename = "E")]
    E,
    #[cfg(target_os = "windows")]
    #[serde(rename = "F")]
    F,
    #[cfg(target_os = "windows")]
    #[serde(rename = "G")]
    G,
    #[cfg(target_os = "windows")]
    #[serde(rename = "H")]
    H,
    #[cfg(target_os = "windows")]
    #[serde(rename = "I")]
    I,
    #[cfg(target_os = "windows")]
    #[serde(rename = "J")]
    J,
    #[cfg(target_os = "windows")]
    #[serde(rename = "K")]
    K,
    #[cfg(target_os = "windows")]
    #[serde(rename = "L")]
    L,
    #[cfg(target_os = "windows")]
    #[serde(rename = "M")]
    M,
    #[cfg(target_os = "windows")]
    #[serde(rename = "N")]
    N,
    #[cfg(target_os = "windows")]
    #[serde(rename = "O")]
    O,
    #[serde(rename = "F1")]
    F1,
    #[serde(rename = "F2")]
    F2,
    #[serde(rename = "F3")]
    F3,
    #[serde(rename = "Return")]
    Return,
}

impl From<LKey> for Key {
    fn from(value: LKey) -> Self {
        match value {
            #[cfg(target_os = "windows")]
            LKey::Num0 => {
                Key::Num0
            }
            #[cfg(target_os = "windows")]
            LKey::Num1 => {
                Key::Num1
            }
            #[cfg(target_os = "windows")]
            LKey::Num2 => {
                Key::Num2
            }
            #[cfg(target_os = "windows")]
            LKey::Num3 => {
                Key::Num3
            }
            #[cfg(target_os = "windows")]
            LKey::Num4 => {
                Key::Num4
            }
            #[cfg(target_os = "windows")]
            LKey::Num5 => {
                Key::Num5
            }
            #[cfg(target_os = "windows")]
            LKey::Num6 => {
                Key::Num6
            }
            #[cfg(target_os = "windows")]
            LKey::Num7 => {
                Key::Num7
            }
            #[cfg(target_os = "windows")]
            LKey::Num8 => {
                Key::Num8
            }
            #[cfg(target_os = "windows")]
            LKey::Num9 => {
                Key::Num9
            }
            #[cfg(target_os = "windows")]
            LKey::A => {
                Key::A
            }
            #[cfg(target_os = "windows")]
            LKey::B => {
                Key::B
            }
            #[cfg(target_os = "windows")]
            LKey::C => {
                Key::C
            }
            #[cfg(target_os = "windows")]
            LKey::D => {
                Key::D
            }
            #[cfg(target_os = "windows")]
            LKey::E => {
                Key::E
            }
            #[cfg(target_os = "windows")]
            LKey::F => {
                Key::F
            }
            #[cfg(target_os = "windows")]
            LKey::G => {
                Key::G
            }
            #[cfg(target_os = "windows")]
            LKey::H => {
                Key::H
            }
            #[cfg(target_os = "windows")]
            LKey::I => {
                Key::I
            }
            #[cfg(target_os = "windows")]
            LKey::J => {
                Key::J
            }
            #[cfg(target_os = "windows")]
            LKey::K => {
                Key::K
            }
            #[cfg(target_os = "windows")]
            LKey::L => {
                Key::L
            }
            #[cfg(target_os = "windows")]
            LKey::M => {
                Key::M
            }
            #[cfg(target_os = "windows")]
            LKey::N => {
                Key::N
            }
            #[cfg(target_os = "windows")]
            LKey::O => {
                Key::O
            }
            LKey::F1 => {
                Key::F1
            }
            LKey::F2 => {
                Key::F2
            }
            LKey::F3 => {
                Key::F3
            }
            LKey::Return => {
                Key::Return
            }
        }
    }
}
